<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Language" content="en-us" />
		
		<title>Cookies</title>
		
		<meta http-equiv="imagetoolbar" content="no" />
		<meta name="MSSmartTagsPreventParsing" content="true" />
		<meta name="Copyright" content="(c) 2007 Copyright content:  Copyright design: Luke Sutton" />
		
		<link rel="stylesheet" href="test.css" type="text/css" media="screen" charset="utf-8">
		
		<script type="text/javascript" language="javascript" charset="utf-8" src="../lib/prototype.js"></script>
		<script type="text/javascript" language="javascript" charset="utf-8" src="../lib/unittest.js"></script>
		<script type="text/javascript" language="javascript" charset="utf-8" src="../src/cookies.js"></script>
		
	</head>
	
	<body>	
	
    <h1>Cookies</h1>
		<div id="testlog"></div>
		<script type="text/javascript" charset="utf-8">
		  new Test.Unit.Runner({
		    testStoringString: function() { with(this) {
		      Cookies.set('storeString', 'storeThisValue');
		      assertEqual("storeThisValue", Cookies.get('storeString'));
		    }},
		    testStoringNumber: function() { with(this) {
		      Cookies.set('storeNumber', 500);
		      var number = Cookies.get('storeNumber');
		      assertNotNull(number);
		      assertEqual(500, number);
		    }},
		    testStoringHash: function() { with(this) {
		      Cookies.set('storeHash', $H({something: 1, anotherThing: 2, yetMore: 3}));
		      var hash = Cookies.get('storeHash');
		      assertNotNull(hash);
		      assert(hash instanceof Hash);
		    }},
		    testStoringArray: function() { with(this) {
		      Cookies.set('storingArray', [1, 2, 3, 4, 5]);
		      var array = Cookies.get('storingArray');
		      assertNotNull(array);
		      assertType(Array, array);
		    }},
		    testRemoveCookie: function() { with(this) {
		      Cookies.set('iStoreToBeCleared', 'ramblingAway');
		      assertNotNull(Cookies.get('iStoreToBeCleared'));
		      Cookies.remove('iStoreToBeCleared');
		      assertNull(Cookies.get('iStoreToBeCleared'));
		    }}
		  });
		</script>		
	
	</body>
</html>
